# coding:utf-8

import urllib
import re

a = 1

def get_content(url):
    global a
    html = urllib.urlopen(url)
    content = html.read()
    html.close()
    return content

def get_image(info):
    regx = r'src="(.*?.jpg)"'

    path = re.compile(regx)

    images_code = re.findall(path, info)

    i = 0
    for image_url in images_code:
        print image_url
        urllib.urlretrieve(image_url, '%s.jpg' % i)
        i += 1

def get_url(info):
    regx = r'http://"()"'

info = get_content('http://www.ivsky.com/bizhi/')
get_image(info)